package ar.com.ford.it.fullEconomics.logic;

import ar.com.ford.it.fullEconomics.exception.FullEconomicsException;
import ar.com.ford.it.fullEconomics.persistence.dao.SFIDao;
import ar.com.ford.it.fullEconomics.persistence.dto.Ncas104SfiVw;
import com.ford.it.logging.ILogger;
import com.ford.it.logging.Level;
import com.ford.it.logging.LogFactory;
import com.ford.it.persistence.PersistenceException;

public class SfiLogic {
    private static final String CLASS_NAME = SfiLogic.class.getName();
    private static final ILogger log = LogFactory.getInstance().getLogger(
            CLASS_NAME);
	/**
	 *	 Obtiene el SFI segun Pk ( Codigo de SFi y code de Linea de Vehiculo)
	 * @param pk
	 * @return
	 * @throws FullEconomicsException 
	 */
    public Ncas104SfiVw getSfiByPk(Ncas104SfiVw pk) throws FullEconomicsException{
        String METHOD_NAME = "getSfiByPk";
        log.entering(CLASS_NAME, METHOD_NAME);
        Ncas104SfiVw result = null;
		try {
			result = (new SFIDao()).getSFIByPk(pk);
		} catch (PersistenceException e) {
            log.logp(Level.SEVERE, CLASS_NAME, METHOD_NAME,
                    "Find all Economic Value Exception", e);
            throw new FullEconomicsException(e,
                    "SFIBYPK");

		}
        log.entering(CLASS_NAME, METHOD_NAME);
        return result;

    }
}
